package com.etrans.web.gps.business.base.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.etrans.web.gps.base.service.BaseService;
import com.etrans.web.gps.business.base.domain.PlatformVO;


/**
 * 平台信息管理Service
 * @author zhangw
 *
 */
@Service
public class PlatformService extends BaseService{
	
	/**
	 * 根据条件查询平台信息列表
	 */
	public List<PlatformVO> queryPlatformList(Map<String, Object> paramMap) {
		return selectList("PlatformQuery.queryPlatformList",paramMap);
	}
	/**
	 * 根据条件查询平台信息列表
	 */
	public Integer queryPlatformListCount(Map<String, Object> paramMap) {
		return selectOne("PlatformQuery.queryPlatformListCount",paramMap);
	}

	/**
	 * 查询平台类型列表
	 */
	public List<HashMap<String,Object>> queryPlatformTypeList() {
		return selectList("PlatformQuery.queryPlatformTypeList",null);
	}
	
	/**
	 * 首先查看是否有重复的唯一编码
	 */
	public Integer queryCountByPlatformUniCode(HashMap<String, Object> paramMap) {
		return selectOne("PlatformQuery.queryCountByPlatformUniCode",paramMap);
	}
	
	/**
	 * 插入平台信息
	 */
	public void insertPlatform(PlatformVO platform) {
		insert("PlatformMapper.insertPlatform",platform);
	}
	
	/**
	 * 修改平台信息
	 */
	public void updatePlatform(PlatformVO platform) {
		update("PlatformMapper.updatePlatform",platform);
	}
	
	/**
	 * 删除平台信息
	 */
	public void deletePlatformByID(Integer platformId) {
		delete("PlatformMapper.deletePlatformByID",platformId);
	}
	
	/**
	 * 根据平台id查询平台信息
	 */
	public PlatformVO queryPlatformById(Integer platformId) {
		return selectOne("PlatformQuery.queryPlatformById",platformId);
	}
	
	/**
	 * 根据平台id查询平台信息
	 */
	public List<PlatformVO> queryExportPlatforms(Map<String, Object> paramMap) {
		return selectList("PlatformQuery.queryExportPlatforms",paramMap);
	}
	
	/**
	 * 根据用户名查找平台数量
	 * @return
	 */
	public Integer queryPlatformByName(String platformName) {
		return selectOne("PlatformQuery.queryPlatformByName",platformName);
	}

}
